package com.scau.yangsuiyu.estore.controller.buyer;

import com.scau.yangsuiyu.estore.controller.myComponent.TopSpan;
import com.scau.yangsuiyu.estore.dababases.entity.Goods;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.layout.AnchorPane;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

/**
 * @author suiyu_yang
 * @description 评论商品界面
 * @date 2019-06-11 21:22
 * @email suiyu_yang@163.com
 */
public class CommentGoodsPane extends AnchorPane implements Initializable {
    private Goods goods;

    @FXML
    private AnchorPane topSpanContainer;


    public CommentGoodsPane(Goods goods) {
        this.goods = goods;
        loadFXML();
    }

    public CommentGoodsPane() {
        loadFXML();
    }

    private void loadFXML() {
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/view/buyer/CommentGoodsPane.fxml"));
        fxmlLoader.setController(this);
        fxmlLoader.setRoot(this);
        try {
            fxmlLoader.load();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        topSpanContainer.getChildren().add(new TopSpan());
    }


}
